/* jshint indent: 1 */

module.exports = function(sequelize, DataTypes) {
	return sequelize.define('file', {
		id: {
			type: DataTypes.BIGINT,
			allowNull: false,
			primaryKey: true,
			autoIncrement: true,
			field: 'id'
		},
		batchNo: {
			type: DataTypes.STRING(50),
			allowNull: true,
			field: 'batch_no'
		},
		fileName: {
			type: DataTypes.STRING(128),
			allowNull: true,
			field: 'file_name'
		},
		fileUrl: {
			type: DataTypes.STRING(255),
			allowNull: true,
			field: 'file_url'
		},
		fileDesc: {
			type: DataTypes.TEXT,
			allowNull: true,
			field: 'file_desc'
		},
		message: {
			type: DataTypes.TEXT,
			allowNull: true,
			field: 'message'
		},
		relatedUrl: {
			type: DataTypes.STRING(255),
			allowNull: true,
			field: 'related_url'
		},
		status: {
			type: DataTypes.INTEGER(2),
			allowNull: true,
			field: 'status'
		},
		createUid: {
			type: DataTypes.STRING(20),
			allowNull: true,
			field: 'create_uid'
		},
		paymentAt: {
			type: DataTypes.DATE,
			allowNull: true,
			field: 'payment_at'
		},
		createdAt: {
			type: DataTypes.DATE,
			allowNull: true,
			field: 'created_at'
		},
		updatedAt: {
			type: DataTypes.DATE,
			allowNull: true,
			field: 'updated_at'
		},
		hash: {
			type: DataTypes.CHAR(64),
			allowNull: true,
			field: 'hash'
		}
	}, {
		tableName: 'file'
	});
};
